import React, { useState, useEffect } from 'react';
import { ConnectRC, connect, history } from 'umi';
import { ConnectState } from '@/models/connect';
import { IndexModelState } from '@/models/modules/index';

import { findAllUser } from '@/service/user';

import './index.less';

interface IndexProps {
  index: IndexModelState;
}

const IndexPage: ConnectRC<IndexProps> = (props) => {
  const [loading, setLoading] = useState<boolean>(false);
  const [userList, setUserList] = useState<any>();

  const { index } = props;

  useEffect(() => {
    findAllUser().then((res) => {
      setUserList(res);
    });
  }, []);

  const goToInsurance = () => {
    history.push({
      pathname: '/vue-app',
      query: {},
    });
  };

  return (
    <div>

    </div>
  );
};

export default connect(({ index }: ConnectState) => ({
  index,
}))(IndexPage);
